<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>我的订单</title>
    <link rel="stylesheet" href="__PUBLIC__/Home/css/personCenter/personOrder.css" >
    <style media="screen">
      td{
        padding-left: 10px;
      }
    </style>
  </head>
  <body>
    <div class="myorder">
      <h1>我的订单</h1>
      <!-- 订单分页 -->
      <div class="tabbox">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td class="wd110">订单号</td>
                <td class="wd115">日期</td>
                <td class="wd100">收货人</td>
                <td class="wd130">订单总额</td>
                <td class="wd90">订单状态</td>
                <td class="wd150">操作</td>
            </tr>
            <foreach name="list" item="val">
            <tr>
                <td><font class="wd80" title="">{$val.order_num}</font></td>
                <td><font class="wd85" title="">{$val.shop_time}</font></td>
                <td><font class="wd70" title="">{$val.receiver}</font></td>
                <td><b><span class="price">{$val.total}</span></b></td>
                <td><font title="">{$val.order_status}</font></td>
                <td class="blue">
                    <!-- <a target="_self" href="{:U('personOrderDetail',array('order_id'=>$val['id'],'addr_id'=>$val['addr_id']))}">查看</a> -->
                    <a target="_self" href="{:U('personOrderDetail',array('order_num'=>$val['order_num']))}">查看</a>
                    <!-- 判断订单状态如果是未评价，则显示评价按钮 ，其他订单状态评价按钮隐藏 -->
                    <if condition="$val['order_status'] eq '未评价'">
                      <a target="_self" href="{:U('goodsEvaluate',array('order_id'=>$val['id'],'user_id'=>$val['user_id']))}">评价</a>
                    </if>
                    <!-- 判断如果订单状态如果是未付款状态 则显示付款按钮和取消按钮 -->
                    <if condition="$val['order_status'] eq '未付款'">
                      <a target="_top" href="{:U('cart/vieworder',array('order_num'=>$val['order_num']))}">付款</a>
                      <a target="_self" href="{:U('orderCancel',array('order_id'=>$val['id'],'user_id'=>$val['user_id']))}">取消订单</a>
                    </if>
                    <!-- 如果是显示未付款，已取消，申请退货则隐藏退货按钮，其他情况显示退货按钮 -->
                    <if condition="$val['order_status'] neq '未付款' and $val['order_status'] neq '已取消' and $val['order_status'] neq '申请退货' and $val['order_status'] neq '退货完成'">
                    <a target="_self" href="{:U('personReturn',array('order_id'=>$val['id'],'user_id'=>$val['user_id']))}">退单</a>
                    </if>
                    <!-- 如果订单是显示已发货状态，则显示确认收货按钮 -->
                    <if condition="$val['order_status'] eq '已发货'">
                      <a target="_self" href="{:U('orderCompletion',array('order_id'=>$val['id'],'user_id'=>$val['user_id']))}">确认收货</a>
                    </if>
                </td>
            </tr>
          </foreach>
          </table>
      </div>
      <!-- 订单分页 -->
      <div style="height:30px;margin-top:15px">
        <div style="height:30px;">
              <div >{$show}</div>
        </div>
      </div>
      <!-- 订单分页结束 -->
    </div>
  </body>
  <script type="text/javascript">
      window.onload = function(){
        var mywidth=document.body.scrollHeight;
        console.log(mywidth);
        top.document.getElementById('show').innerHTML = mywidth;
        top.back();
      };
  </script>
</html>
